/**
 * Copyright (c) 2010 Simple Graph Tools contributors. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * $Id$
 */
package org.sgt.coredef;

import org.eclipse.emf.common.util.EList;

/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>Chain</b></em>'.
 * <!-- end-user-doc -->
 *
 * <!-- begin-model-doc -->
 *  A Chain is a ordered sequence of Nodes , associated to an unordered list of edges.<BR/>
 *  <p>
 *  The first and last nodes have been particularized for a more user friendly access and modeled
 *  respectively as startNode and endNode. Essentially, the ordered list of nodes is the following one:
 *  StartNode&nbsp;---&nbsp;nodes(0)&nbsp;...&nbsp;nodes(n)&nbsp;----&nbsp;EndNode<BR/>
 *  </p>
 *  <p>The model does not ensure any ordering of edges or correlation of them with the nodes list in any way.
 *  The eOperations do however provide means to determined whether a Chain does correspond to those
 *  criteria. Typically a non-looping, complete Chain with n+1 inner-nodes should have n+2 edges and
 *  be sequenced as :
 *  StartNode&nbsp;-edge(0)-&nbsp;node(0)&nbsp;-edge(1)&nbsp;....&nbsp;edge(n)-&nbsp;node(n)&nbsp;-edge(n+1)-&nbsp;EndNode<BR/>
 *  </p>
 * 
 * <!-- end-model-doc -->
 *
 * <p>
 * The following features are supported:
 * <ul>
 *   <li>{@link org.sgt.coredef.Chain#getEdges <em>Edges</em>}</li>
 *   <li>{@link org.sgt.coredef.Chain#getNodes <em>Nodes</em>}</li>
 *   <li>{@link org.sgt.coredef.Chain#getStartNode <em>Start Node</em>}</li>
 *   <li>{@link org.sgt.coredef.Chain#getEndNode <em>End Node</em>}</li>
 * </ul>
 * </p>
 *
 * @see org.sgt.coredef.CoredefPackage#getChain()
 * @model
 * @generated
 */
public interface Chain extends ConditionableObject, ConstrainedObject {
	/**
	 * Returns the value of the '<em><b>Edges</b></em>' reference list.
	 * The list contents are of type {@link org.sgt.coredef.Edge}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Edges</em>' reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Edges</em>' reference list.
	 * @see org.sgt.coredef.CoredefPackage#getChain_Edges()
	 * @model
	 * @generated
	 */
	EList<Edge> getEdges();

	/**
	 * Returns the value of the '<em><b>Nodes</b></em>' reference list.
	 * The list contents are of type {@link org.sgt.coredef.Node}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Nodes</em>' reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Nodes</em>' reference list.
	 * @see org.sgt.coredef.CoredefPackage#getChain_Nodes()
	 * @model
	 * @generated
	 */
	EList<Node> getNodes();

	/**
	 * Returns the value of the '<em><b>Start Node</b></em>' reference.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Start Node</em>' reference isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Start Node</em>' reference.
	 * @see #setStartNode(Node)
	 * @see org.sgt.coredef.CoredefPackage#getChain_StartNode()
	 * @model
	 * @generated
	 */
	Node getStartNode();

	/**
	 * Sets the value of the '{@link org.sgt.coredef.Chain#getStartNode <em>Start Node</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Start Node</em>' reference.
	 * @see #getStartNode()
	 * @generated
	 */
	void setStartNode(Node value);

	/**
	 * Returns the value of the '<em><b>End Node</b></em>' reference.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>End Node</em>' reference isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>End Node</em>' reference.
	 * @see #setEndNode(Node)
	 * @see org.sgt.coredef.CoredefPackage#getChain_EndNode()
	 * @model
	 * @generated
	 */
	Node getEndNode();

	/**
	 * Sets the value of the '{@link org.sgt.coredef.Chain#getEndNode <em>End Node</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>End Node</em>' reference.
	 * @see #getEndNode()
	 * @generated
	 */
	void setEndNode(Node value);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model kind="operation"
	 * @generated
	 */
	boolean isComplete();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model
	 * @generated
	 */
	boolean canGrowForward(Node node);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model
	 * @generated
	 */
	boolean canGrowBackwards(Node node);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model
	 * @generated
	 */
	Chain copy();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model
	 * @generated
	 */
	Node nextNode(Node currentNode);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model
	 * @generated
	 */
	boolean appendNode(Node node, Node toNode);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model
	 * @generated
	 */
	Node previousNode(Node node);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model
	 * @generated
	 */
	boolean prependNode(Node node, Node toNode);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model kind="operation"
	 * @generated
	 */
	boolean isLooping();

} // Chain
